package com.qfedu.scode.controller;

import com.qfedu.scode.entity.Student;
import com.qfedu.scode.service.intf.StudentService;
import com.qfedu.scode.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: StartCoding
 * @description:
 * @author: Feri(邢朋辉)
 * @create: 2021-01-05 11:31
 */
@RestController
@RequestMapping("/api/student/")
@Api(tags = "学生操作")
public class StudentController {
    @Autowired
    private StudentService studentService;

    @ApiOperation(value = "实现学生新增",notes = "实现学生新增")
    @PostMapping("save.do")
    public R save(@RequestBody Student student){
        return studentService.save(student);
    }
    @ApiOperation(value = "实现全部学员的查询",notes = "实现全部学员的查询")
    @GetMapping("all.do")
    public R all(){
        return studentService.queryAll();
    }
}
